#ifndef __PVMVOICESOURCESPEEX_H__
#define __PVMVOICESOURCESPEEX_H__

#include "pvm/pvmapi.h"
#include "lib/pvmvoicesource.h"
#include "lib/decoders/speex/pvmvoicespeex.h"
#include "lib/decoders/speex/pvmspeexincludes.h"

#include "lib/memory/pvmmemory.h"

class PVMVoiceSourceSpeex : public IPVMVoiceSource, public PVMAllocableObject
{
protected:
	IPvmInStream* stream;
	pvm_bool	streamIsUsed;
public:
	PVMVoiceSourceSpeex(IPvmInStream* stream);

	virtual ~PVMVoiceSourceSpeex();

	virtual IPVMVoice* CreateVoice(pvm_int samplesPerSecond, pvm_int bitsPerSample, pvm_int chanelsNum);
	virtual void Destroy();
	virtual pvm_int GetLengthMS();

	virtual pvm_bool GetOption(const pvm_char* optionName, void* optionVal, pvm_uint32* optionSize);
	virtual pvm_bool SetOption(const pvm_char* optionName, void* optionVal, pvm_uint32 optionSize);
};

#endif
